#include "Globals.hh"

u2 const UNLIMITED = 0xffff;
u2 const DEFAULT_PORT = 55555;
double const GALAXY_SIZE = 64;

# define TO_NUM(TYPE, METHOD)                                               \
    template<> TYPE to_num< TYPE >(QString const& numStr, bool* convOk) {   \
        return numStr.to##METHOD(convOk);                                   \
    }                                                                       \

TO_NUM(u1, UShort)      TO_NUM(i1, Short)
TO_NUM(u2, UShort)      TO_NUM(i2, Short)
TO_NUM(u4, UInt)        TO_NUM(i4, Int)
TO_NUM(u8, ULongLong)   TO_NUM(i8, LongLong)
TO_NUM(f4, Float)
TO_NUM(f8, Double)
TO_NUM(f16, Double)

# undef TO_NUM

QString to_str(QString value) {
    return value;
}
